/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.agi.util.sound;

import javax.sound.sampled.*;

/**
 *
 * @author Renato
 */
public abstract class BuscadorLine<T extends Line> implements FornecedorAudioFormat {
     

    @Override
    public abstract AudioFormat getAudioFormat();
    
    protected abstract Class<T> getClassLine();
    
    public T getLine() throws LineUnavailableException {
        T target;
        DataLine.Info info = new DataLine.Info(getClassLine(), getAudioFormat());
        target=(T) AudioSystem.getLine(info);
        return target;
    }
}
